    const positionListTpl = require('../views/position.list.html')
    const positionListlist = require('../views/position.list.list.html')
    import swiper from './banner';
    import index from './index';
    import fetch from '../models/fetch'
    // const fetch = require('../models/fetch')
    let positionList = []

    const render = async function(){
      index.render()
      swiper.banner()
      let result = await fetch.get('/api/index/article_list_ads?page=1')
      result = JSON.parse(result)

        let res = result.data.ads_info;
        let renderedPositionListTpl = template.render(positionListTpl, { res })
        $('#All').append(renderedPositionListTpl)
        console.log(res)
      
        for (let i = 0; i< res.length; i++) {
          let data = positionList = result.data.ads_info[i].product_info;
          let listlist = template.render(positionListlist, { data })
          $('.G1').eq(i).prepend(listlist)
        }

     console.log(123)
    
  
    }


  export default {
    render
}   